#include "../hle.h"

void sceAtracAddStreamData()
{
    _log(ERR, HLE, "UNIMPL sceAtracAddStreamData(%d, %d)", PARAM(0), PARAM(1));
    RETURN(-1);
}

void sceAtracDecodeData()
{
    _log(ERR, HLE, "UNIMPL sceAtracDecodeData(%d, ....)", PARAM(0));
    RETURN(-1);
}

void sceAtracEndEntry()
{
    _log(ERR, HLE, "UNIMPL sceAtracEndEntry");
    RETURN(-1);
}

void sceAtracGetAtracID()
{
    _log(ERR, HLE, "UNIMPL sceAtracGetAtracID");
    RETURN(-1);
}

void sceAtracGetBufferInfoForReseting()
{
    _log(ERR, HLE, "UNIMPL sceAtracGetBufferInfoForReseting");
    RETURN(-1);
}

void sceAtracGetBitrate()
{
    _log(ERR, HLE, "UNIMPL sceAtracGetBitrate");
    RETURN(-1);
}

void sceAtracGetChannel()
{
    _log(ERR, HLE, "UNIMPL sceAtracGetChannel");
    RETURN(-1);
}

void sceAtracGetLoopStatus()
{
    _log(ERR, HLE, "UNIMPL sceAtracGetLoopStatus");
    RETURN(-1);
}

void sceAtracGetInternalErrorInfo()
{
    _log(ERR, HLE, "UNIMPL sceAtracGetInternalErrorInfo");
    RETURN(-1);
}

void sceAtracGetMaxSample()
{
    _log(ERR, HLE, "UNIMPL sceAtracGetMaxSample");
    RETURN(-1);
}

void sceAtracGetNextDecodePosition()
{
    _log(ERR, HLE, "UNIMPL sceAtracGetNextDecodePosition(%d, %08x)", PARAM(0), PARAM(1));
    RETURN(-1);
}

void sceAtracGetNextSample()
{
    _log(ERR, HLE, "UNIMPL sceAtracGetNextSample");
    RETURN(-1);
}

void sceAtracGetRemainFrame()
{
    _log(ERR, HLE, "sceAtracGetRemainFrame(%d, %08x)", PARAM(0), PARAM(1));
    RETURN(-1);
}

void sceAtracGetSecondBufferInfo()
{
    _log(ERR, HLE, "sceAtracGetSecondBufferInfo(%d, %08x, %08x)", PARAM(0), PARAM(1), PARAM(2));
    RETURN(SCE_ERROR_ATRAC_SECOND_BUFFER_NOT_NEEDED);
}

void sceAtracGetSoundSample()
{
    u32 endSampleAddr = PARAM(1);
    u32 loopStartSampleAddr = PARAM(2);
    u32 loopEndSampleAddr = PARAM(3);
    _log(ERR, HLE, "UNIMPL sceAtracGetSoundSample(%d, %08x, %08x, %08x)", PARAM(0), PARAM(1), PARAM(2), PARAM(3));
    mem_write32(endSampleAddr, 0);
    mem_write32(loopStartSampleAddr, -1);
    mem_write32(loopEndSampleAddr, -1);
    RETURN(0);
}

void sceAtracGetStreamDataInfo()
{
    _log(ERR, HLE, "UNIMPL sceAtracGetStreamDataInfo");
    RETURN(-1);
}

void sceAtracReleaseAtracID()
{
    _log(ERR, HLE, "UNIMPL sceAtracReleaseAtracID");
    RETURN(0);
}

void sceAtracResetPlayPosition()
{
    _log(ERR, HLE, "UNIMPL sceAtracResetPlayPosition");
    RETURN(-1);
}

void sceAtracSetHalfwayBuffer()
{
    _log(ERR, HLE, "UNIMPL sceAtracSetHalfwayBuffer");
    RETURN(-1);
}

void sceAtracSetSecondBuffer()
{
    _log(ERR, HLE, "UNIMPL sceAtracSetSecondBuffer(%d, %08x, %d)", PARAM(0), PARAM(1), PARAM(2));
    RETURN(-1);
}

void sceAtracSetData() /* ? */
{
    _log(ERR, HLE, "UNIMPL sceAtracSetData");
    RETURN(-1);
}

void sceAtracSetDataAndGetID()
{
    _log(ERR, HLE, "UNIMPL sceAtracSetDataAndGetID(%08x, %08x)", PARAM(0), PARAM(1));
    RETURN(300);
}

void sceAtracSetHalfwayBufferAndGetID()
{
    _log(ERR, HLE, "UNIMPL sceAtracSetHalfwayBufferAndGetID");
    RETURN(-1);
}

void sceAtracStartEntry()
{
    _log(ERR, HLE, "UNIMPL sceAtracStartEntry");
    RETURN(-1);
}

void sceAtracSetLoopNum()
{
    _log(ERR, HLE, "UNIMPL sceAtracSetLoopNum(%d, %d)", PARAM(0), PARAM(1));
    RETURN(-1);
}

